import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;

public class Prova {
	static String url = "jdbc:mysql://localhost:3306/test";
	static String user = "root";
	static String password = "dom94schi";

	public static void main(String[] args) throws Exception {
		print(null);
	}

	private static void print(String studenti) throws Exception {
	
		Connection con = DriverManager.getConnection(url, user, password);
		ResultSet rs = con.createStatement().executeQuery("select * from id");
		while (rs.next()) {
			System.out.println(rs.getString(1) + "\t\t" + rs.getInt(2));
		}
		rs.close();
		con.close();
		

	}

}
